package main;
import java.io.File;
import java.io.IOException;

import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;

import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;



public abstract class testxml {

	/**
	 * @param args
	 * @throws ParserConfigurationException 
	 * @throws IOException 
	 * @throws SAXException 
	 * @throws TransformerException 
	 */
	public static void main(String[] args) throws ParserConfigurationException, SAXException, IOException, TransformerException {
		// TODO Auto-generated method stub
	File  t = new  File("c:\\Users\\Jan\\test.xml");
	
	File tTwo = new File("testRename.xml");
	t.renameTo(tTwo);
	System.out.print(t.getParent());
	
	
		//MP3ConversionManager.convertToMp3();
// ArrayList<MusicFile> t =  XMLHandler.parseXMLToMusicFileList(new File("C:\\Users\\Jan\\Desktop\\test.xml"));
// XMLHandler.addMusicFile(t.get(0));
 
//		File fXmlFile = new File("C:\\Users\\Jan\\Desktop\\test.xml");
//		DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
//		DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
//		Document doc = dBuilder.parse(fXmlFile);
//		NodeList t = doc.getElementsByTagName("file");
//		for(int tel = 0  ; tel < t.getLength(); tel++) {
//			Node temp =  t.item(tel);
//		
//			System.out.println(getTagValue("type", (Element)temp));
//			
//		}
//		TransformerFactory transformerFactory = TransformerFactory.newInstance();
//		Transformer transformer = transformerFactory.newTransformer();
//		DOMSource source = new DOMSource(doc);
//		StreamResult result = new StreamResult(new File("C:\\Users\\Jan\\Desktop\\test.xml"));
//		transformer.transform(source, result);
//		String tols = "12.2.2222";
//		String tolsa = "12/2/2222";
//		String [] al = tols.split("[\\.]+[/]");
//		String [] el = tolsa.split("(\\.)+(/)");
	}
	 private static String getTagValue(String sTag, Element eElement) {
			NodeList nlList = eElement.getElementsByTagName(sTag).item(0).getChildNodes();
		 
		        Node nValue = (Node) nlList.item(0);
 
			return nValue.getNodeValue();
		  }
}
